﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="${pageContext.request.contextPath}/css/themes/default/easyui.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/css/themes/icon.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/css/themes/color.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/css/apply.css" rel="stylesheet" />
    <script src="${pageContext.request.contextPath}/script/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/script/jquery.easyui.min.js"></script>
    <title>申请审批</title>
    <style>

    </style>
</head>
<body>
	
    <div class="server">
        <h3 class="apply_title">修改订单</h3>
        <table class="table">
        <form id="f">
         <input type="hidden" name="id" value="${express.id}">
         <input type="hidden" name="sp" value="${express.sp}">
         <input type="hidden" name="yszt" value="${express.yszt}">
         <input type="hidden" name="ydqy" value="${express.ydqy}">
            <tr>
                <td colspan="6" class="head">申请人信息</td>
            </tr>
            <tr>
                <td class="first">申请人<span class="xing">*</span>：</td>
                <td class="input"><input type="text" name="sqr" value="${express.sqr}" /></td>
               
                <td class="first">手机<span class="xing">*</span>：</td>
                <td class="input"><input type="text" id="sqrsj" name="sqrsj" value="${express.sqrsj}"/></td>
                <td>揽件时间<span class="xing">*</span>：</td>
                <td><!-- <input type="datetime" id="CreationTime" class="easyui-datebox" name="sqsj"/> -->
                	<input type ="text" name ="sqsj" value="${express.sqsj}"/>
                </td>
            </tr>
            <tr>
                <td colspan="6" class="head">收件人信息</td>
            </tr>
            <tr>
                <td class="first">收件人<span class="xing">*</span>：</td>
                <td class="input"><input type="text" name="sjr" value="${express.sjr}"/></td>
                <td class="first">手机<span class="xing">*</span>：</td>
                <td class="input"><input type="text" id="sjrsj" name="sjrsj" value="${express.sjrsj}"/></td>
                 <td class="first">单号<span class="xing">*</span>：</td>
                <td class="input"><input type="text" name="dh" value="${express.dh}"/></td>
            </tr>
            <tr>
                <td colspan="6" class="head">快递信息</td>
            </tr>
            <tr>
                <td class="first">快递区域<span class="xing">*</span>：</td>
                	<td class="input"><input type="text" name="kdqy" value="${express.kdqy}"/>
                </td>
                <td class="first">快递类型<span class="xing">*</span>：</td>
                	<td class="input"><input type="text" name="kdlx" value="${express.kdlx}"/>
                </td>
                <td class="first">快递公司<span class="xing">*</span>：</td>
                	<td class="input"><input type="text" name="kdgs" value="${express.kdgs}"/>
                </td>
            </tr>
            <tr>
                <td class="first">邮编<span class="xing">*</span>：</td>
                <td class="input"><input type="text" id="yb" name="yb" value="${express.yb}"/></td>
                <td class="first">邮寄地址<span class="xing">*</span>：</td>
                <td colspan="4" class="input"><input class="addr" type="text" name="yjdz" value="${express.yjdz}"/></td>
            </tr>
            <tr>
                <td colspan="6" class="head">申请说明</td>
            </tr>
            <tr>
                <td class="secend" style="height:60px;" colspan="6">
                    <input style="width: 978px;height: 80px" type="text" name="sqsm" value="${express.sqsm}"></input>
                </td>
            </tr>
            <tr>
                <td colspan="6" class="head">备注</td>
            </tr>
            <tr>
                <td class="secend" style="height:60px;" colspan="6">
                    <input style="width: 978px;height: 80px" type="text" name="bz" value="${express.bz}"></input>
                </td>
            </tr>
            <tr>
                <td colspan="6" style="height:35px;">
                    <input type="button" class="easyui-linkbutton c1" style="width:50px;height: 30px;margin-left: 300px;" onclick="updateexpress()" value="提交"/>
                    <a href="javascript:void(0);" class="easyui-linkbutton c8" style="width:50px;height: 29px;margin-left: 300px;" onclick="window.print()">打印</a> 
                </td>
            </tr>
        </form>
</table>
    </div>
    <script>
        $(function () {
            $(".apply_proaddr").hide();
            $(".apply_counaddr").hide();
        })
        $(".apply_range").change(function () {
            var name = $(this).val();
            console.log(name);
            if (name=="国内") {
                $(".apply_proaddr").show();
                $(".apply_counaddr").hide();
            } else if (name=="国外") {
                $(".apply_proaddr").hide();
                $(".apply_counaddr").show ();
            } else if (name=="请选择") {
                $(".apply_proaddr").hide();
                $(".apply_counaddr").hide();
            } 
        })
        
        
        function updateexpress(){
        	var formData = new FormData($("#f")[0]);
        	var sqrsj=$("#sqrsj").val();
        	var sjrsj=$("#sjrsj").val();
        	var yb=$("#yb").val();
				$.ajax({
					url:"${pageContext.request.contextPath}/admin/adminupdateexpress",
					type:"POST",				
					data:formData,
					dataType:"json",
					async: false,
	                cache: false,
	                contentType: false,
	                processData: false,	
					success:function(data){
       				 	alert("编辑成功！！！");
						window.location.href="/TxmSy/adminlistexpress.html";
					},
					error:function(){
					if(sqrsj.length!=11 || sjrsj.length!=11){
						alert("手机号码格式错了！");
					}
					if(yb.length!=6){
						alert("邮编格式错了！");
					}else
						alert("请查看是否有未填写的信息！申请失败！！！");
					}
				});
			}
    </script>
</body>
</html>